package actors

import (
	"engine"
	"engine/log"
	"gitee.com/ameise84/e3dds"
	time "gitee.com/ameise84/e3time"
	"servers/models/define"
)

var _gService e3dds.NetService

func init() {
	var err error
	_gService, err = engine.RegisterNetService(define.ServiceApiBackend, &ActorBuilder{})
	if err != nil {
		log.GetLogger().Fatal(err.Error()).Println()
	}
}

type ActorBuilder struct{}

func (a ActorBuilder) TakeActor() e3dds.Actor {
	return &Actor{}
}

func (a ActorBuilder) FreeActor(actor e3dds.Actor) {

}

func (a ActorBuilder) OnBroadcast(request e3dds.Request) {

}

type Actor struct{}

func (a Actor) Load(s string, behavior e3dds.Behavior) error {
	return nil
}

func (a Actor) Unload(b bool) {

}

func (a Actor) OnTimer(kind uint16, id uint32, now time.Time, ctx e3dds.TimerContext) bool {
	return true
}

func (a Actor) OnRecvMsg(behavior e3dds.Behavior, request e3dds.Request) bool {
	return true
}
